import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s = in.next();
        if (s.equals("ab")) {
            System.out.println(1);
            return;
        }
        char[] sc = s.toCharArray();
        int len = sc.length;
        int idx = 0;
        int cnt = 0;
        while(true){
            if(idx >= len) break;
            boolean flagB = false;
            int ca = 0, cb = 0;
            if (sc[idx] == 'a') {
                while (idx<len&&sc[idx] == 'a') {
                    ca++;
                    idx++;
                }
                while (idx<len&&sc[idx] == 'b') {
                    flagB = true;
                    cb++;
                    idx++;
                }
            }
            if (flagB) {
                cnt = (cnt % 1000000007 + ca % 1000000007 + cb % 1000000007) % 1000000007;
            }
        }
        System.out.println(cnt);


    }


}
